//
//  NICornerCoverView.m
//  AIWAYS
//
//  Created by Marx on 2018/8/14.
//  Copyright © 2018年 wlq. All rights reserved.
//

#import "NICornerCoverView.h"

#define DEGREES_TO_RADIANS(degrees)((M_PI * degrees)/180)
@implementation NICornerCoverView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //设置 背景为clear
        self.backgroundColor = [UIColor clearColor];
//        self.opaque = NO;
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        
        //设置 背景为clear
        self.backgroundColor = [UIColor clearColor];
//        self.opaque = NO;
    }
    return self;
}

- (void)drawRect:(CGRect)rect {
    
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    [[UIColor whiteColor] setFill];
    UIRectFill(rect);
    CGContextAddRect(ctx, rect);
    CGContextFillPath(ctx);
    CGContextSetBlendMode(ctx, kCGBlendModeClear);
    
    //画圆
    CGContextAddEllipseInRect(ctx, rect);
    
    //填充
    CGContextFillPath(ctx);
    
}
@end
